package string;

/**
 * 说明:
 *
 * @author: luohaowei
 * @date:2023/3/1
 **/
public class MatchesDemo {
    public static void main(String[] args) {
        /*
        [a-zA-Z0-9_]+@[a-zA-Z0-9]+(\.[a-zA-Z]+)+
         */
        String email="wx@dm.cn";
        String regex="[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";
        boolean match=email.matches(regex);
        if(match){
            System.out.println("yes");
        }else {
            System.out.println("no");
        }
    }
}
